package com.lizhi.yun.core.eureka.controller;

import com.lizhi.common.yun.entity.ListResponseResult;
import com.lizhi.yun.core.eureka.handler.EurekaInfoHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: lizhi
 * @Description:
 * @Date: create in 2020/7/11 9:58
 */
@RestController
@RequestMapping(path = "/api/upp/eureka")
public class EurekaInfoController {

    @Resource
    private EurekaInfoHandler eurekaInfoHandler;

    @RequestMapping(path = "/getDeploys")
    public ListResponseResult getDeploys(@RequestParam Map<String, Object> map){
        return eurekaInfoHandler.getDeploys(map);
    }

    @RequestMapping(path = "/handleStop")
    public ListResponseResult handleStop(String addr, String port){
        return eurekaInfoHandler.handleStop(addr, port);
    }

    @RequestMapping(path = "/handleStart")
    public ListResponseResult handleStart(String addr, String port){
        return eurekaInfoHandler.handleStart(addr, port);
    }
}
